Conventional rounding operations require a rounding up or rounding down depending on whether a final calculation result exceeds or is less than a threshold. For example, consider a situation where calculations results from a Multiply and Accumulate unit (MAC) are rounded to a given degree of accuracy or with a predetermined number of significant digits
Where a calculation result is between adjacent values at the predetermined number of significant digits, say X.Y, where X.Y is a value between X and X+1, and X is an arbitrary value at a predetermined accuracy or number of significant digits. In simple terms, a decision could be made always to round down to X or to round up to X+1. However, more typically, a rounding is made to the nearest value at the predetermined accuracy. Accordingly if the calculation result is greater than X.5, rounding is made to the next higher value, namely X+1. If the calculation result is less than X.5, rounding is made to the next lower value, namely X. This leaves, however, the question open as to how to treat a calculation result which is exactly X.5. Typically, processors have employed a solution where X.5 is either always rounded up to X+1, or alternatively rounded down to X. It will be appreciated that these rounding solutions add a bias to the overall calculation of the calculation. Although in isolation this is typically not significant, if the calculation resulting in the rounding from X.5 is computed very often, which can happen in applications where many repetitions occur, this can lead to the insignificant bias becoming significant.
According there is a need for a new approach to rounding which can provide unbiased rounding in an efficient manner. The present invention seeks to achieve this.